package asteroids.model.programs.parsing.statements;

import java.util.ArrayList;
import java.util.List;

public abstract class CollectionStatement extends S{

	public CollectionStatement(int line, int column, S body) {
		super(line, column);
		setBody(body);
		executedList = new ArrayList<S>();
	}
	
	public void setBody(S body){
		this.body = body;
	}
	
	public S getBody(){
		return this.body;
	}
	
	public boolean isLoopFinished() {
		return loopFinished;
	}

	public void setLoopFinished(boolean finished) {
		this.loopFinished=finished;
	}
	
	public void resetExecutedList(){
		executedList.clear();
	}

	public List<S> getExecutedList() {	//CLONED
		List<S> listToReturn = new ArrayList<S>();
		listToReturn= executedList;
		return listToReturn;
	}

	public void addAsExecuted(S s) {
		executedList.add(s);
	}

	private List<S> executedList;
	boolean loopFinished;
	private S body;



}
